//
//  SheetStyleModel.swift
//  Exchange
//
//  Created by 孟祥群 on 2018/5/24.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit
enum wtStyle {
    case commonStyle
    case sectionStyle
}
class SheetStyleModel: BaseModel {
    var style:wtStyle?
    var name:String = ""
    var selectBool = false //是否被选中
    
    
    class func changeModel(style:sheetStyle) -> Array<Array<SheetStyleModel>>{
        var titleArr:Array<Array<String>>
        if style == .leverSelectStyle {
            titleArr =  [[],[kText("订单类型")],[kText("全部"),kText("市价买入"),kText("市价卖出"),kText("限价买入"),kText("限价卖出")],[kText("订单状态")],[kText("全部"),kText("止损平仓"),kText("止盈平仓"),kText("已完成"),kText("已取消")],[kText("重置"),kText("确定")]]
        }else {
            titleArr =  [[],[kText("订单状态")],[kText("买入"),kText("卖出")],[kText("重置"),kText("确定")]]
        }
   
        var leverSheetArr: Array<Array<SheetStyleModel>> = []
        for nameArr in titleArr {
            var arr:Array<SheetStyleModel> = []
            for i in 0..<nameArr.count {
                let nameStr = nameArr[i]
                let model = SheetStyleModel()
                model.name = nameStr
                if nameStr == kText("订单类型") ||  nameStr == kText("订单状态") {
                    model.style = wtStyle.sectionStyle
                }else {
                    model.style = wtStyle.commonStyle
                }
                
                if i == 0 && nameStr != kText("重置"){
                    model.selectBool = true
                }
                
                arr.append(model)
            }
            leverSheetArr.append(arr)
        }
        return leverSheetArr
    }
}
